#import <Foundation/Foundation.h>
#import "SFUEvent.h"
#import "WebParsable.h"
#import "SFUConstants.h"

/**
 * An SFUWebSource is an object representing an SFU website 
 * with parsable events.
 *
 * Conforms to the WebParsable protocol.
 *
 * @author      James Lin
 * @version     0.5.0
 * @since       0.0.2
 * @see         WebParsable
 */
@interface SFUWebSource : NSObject <WebParsable> {
	id<SFUConnectionDelegate> delegate;     // Delegate handling connection events
	NSURL*                    sourceURL;    // Absolute URL of the website
	NSMutableURLRequest*      request;      // The URL request for connection
	NSURLConnection*          connection;   // The URL connection
	NSMutableData*            receivedData; // Data received from the connection
	NSString*                 sourceCode;   // Source code of the website
}

@property (nonatomic, retain) NSURL* sourceURL;
@property (nonatomic, retain) NSString* sourceCode;

/**
 * Get the delegate handling connection events.
 *
 * @return  the delegate handling connection events
 */
- (id)delegate;

/**
 * Initialize the load request to SFU website and retrieve source code.
 */
- (void) initConnection;

@end
